
package com.sec.android.app.myfiles.module.local.recent;

import android.provider.MediaStore;

import com.sec.android.app.myfiles.provider.DbTableInfo;

public class RecentDbTableInfo extends DbTableInfo {

    private static RecentDbTableInfo mInstance = null;

    public static DbTableInfo getInstance() {
        if (mInstance == null) {
            mInstance = new RecentDbTableInfo();
        }

        return mInstance;

    }

    private RecentDbTableInfo() {
        mTableColumn.add(new DB_Column(COLUMN_ID.ID, "_id", "integer PRIMARY KEY AUTOINCREMENT"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DOWNLOAD_ID, "_fileid", "integer not null default -1"));
        mTableColumn.add(new DB_Column(COLUMN_ID.NAME, "name", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.FILE_TYPE, "file_type", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.SIZE, "size", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DATE, "date", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.PATH, "_data", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.EXT, "ext", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.MIME_TYPE, "mime_type", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.SOURCE, "_source", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DESCRIPTION, "_description", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.STATUS, "_status", "INTEGER"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DOWNLOAD_BY, "_download_by", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DOWNLOADED_ITEM_VISIBILITY, "_download_item_visibility", "BOOLEAN NOT NULL DEFAULT 1"));
        mTableColumn.add(new DB_Column(COLUMN_ID.RECENT_DATE, "recent_date", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.IS_360_CONTENTS, "is_360_contents", "integer"));

        mTableColumn.add(new DB_Column(COLUMN_ID.WIDTH, MediaStore.Files.FileColumns.WIDTH, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.HEIGHT, MediaStore.Files.FileColumns.HEIGHT, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DURATION, MediaStore.Video.VideoColumns.DURATION, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ARTIST, MediaStore.Audio.AlbumColumns.ARTIST, "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ALBUM, MediaStore.Audio.AlbumColumns.ALBUM, "integer"));
    }

    @Override
    public String getTableName() {
        final String tableName = "recent_files";
        return tableName;
    }

    @Override
    public boolean isRealDb() {
        return true;
    }

}
